This package intends to import and export RFC compliant DNS resource records. Please raise an issue if you a valid resource record fails to pass or an invalid resource record passes.
This package is for working with individual Resource Records. For working with zones of RRs, use dns-zone.
Validate records by passing a properly formatted JS object to the record-specific class. To validate an A record:
const validatedA = newRR.A(exampleRRs.A)
Manipulate the validated record using pattern named setters:
console.log(validatedA.toBind())
test.example.com. 3600IN A 192.0.2.127
validatedA.setAddress('192.0.2.128')
console.log(validatedA.toBind())
test.example.com. 3600IN A 192.0.2.128
The setters are named: set + Field, where field is the resource record field name to modify. Multi-word names are camel cased, so a field named Certificate Usage has a setter named setCertificateUsage. The RFCs aren't always consistent regarding RR field names so aliases are permissible for interoperability.
FUNCTIONS
Get the field names for each RR type with getFields():
console.log(newRR.A(exampleRRs.A).toBind())
test.example.com3600IN A 192.0.2.127console.log(newRR.AAAA(exampleRRs.AAAA).toBind())
test.example.com3600INAAAA2605:7900:20:a::4
to{Bind|MaraDNS} output can be influenced (suppress TTL, class, relative domain names) with an options object. See it in bin/dns-zone in the dns-zone package.
RFC 4034: if the type of RR is NS, MD, MF, CNAME, SOA, MB,
MG, MR, PTR, HINFO, MINFO, MX, RP, AFSDB, RT, SIG, PX, NXT,
NAPTR, KX, SRV, DNAME, A6, RRSIG, or NSEC, all uppercase
letters in the DNS names contained within the RDATA are replaced by the lowercase letters;
The npm package @nictool/dns-resource-record receives a total of 4 weekly downloads. As such, @nictool/dns-resource-record popularity was classified as not popular.
We found that @nictool/dns-resource-record demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Last updated on 11 Mar 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.
ua-parser-js is set to drop the MIT license and adopt a controversial dual AGPLv3 + PRO licensing model in its upcoming v2.0 release, raising significant concerns among developers and enterprise users.
Researchers recently demonstrated that the npm Registry is vulnerable to cache poisoning combined with DoS, posing significant risks for package availability.